#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
long long arr[100010];
//int diff[100010];
long long n, ans1, ans2;
long long z, f;
int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &arr[i]);
	}
	for (int i = 2; i <= n; i++) {
		int tmp = arr[i] - arr[i - 1];
		if (tmp > 0) {
			z += tmp;
		}
		else if (tmp < 0) {
			f += abs(tmp);
		}
	}
	ans1 = max(z, f);
	ans2 = abs(z - f) + 1;
	cout << ans1 << endl << ans2;
	return 0;
}